home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DATETIME.SWG / 0012_EASTER.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  73 lines

  1. {    ===============================================================
  2.     From chapter 4 of "Astronomical Formulae for Calculators" 2nd
  3.     edition; by Jean Meeus; publisher: Willmann-Bell Inc.,
  4.     ISBN 0-943396-01-8 ...
  5.  
  6.                             Date of Easter.
  7.  
  8.     The method used below has been given by Spencer Jones in his
  9.     book "General Astronomy" (pages 73-74 of the edition of 1922).
  10.     It has been published again in the "Journal of the British
  11.     Astronomical Association", Vol.88, page 91 (December 1977)
  12.     where it is said that it was devised in 1876 and appeared in
  13.     the Butcher's "Ecclesiastical Calendar."
  14.  
  15.     Unlike the formula given by Guass, this method has no exception
  16.     and is valid for all years in the Gregorian calendar, that is
  17.     from the year 1583 on.
  18.  
  19.     [...text omitted...]
  20.  
  21.     The extreme dates of Easter are March 22 (as in 1818 and 2285)
  22.     and April 25 (as in 1886, 1943, 2038).
  23.     ===============================================================
  24.  
  25.     The following Modula-2 code by Greg Vigneault, April 1993.
  26.  
  27.     Converted To Pascal by Kerry Sokalsky
  28. }
  29. Procedure FindEaster(Year : Integer);
  30. { Year MUST be greater than 1583 }
  31. VAR
  32.   a, b, c,
  33.   d, e, f,
  34.   g, h, i,
  35.   k, l, m,
  36.   n, p  : INTEGER;
  37.   Month : String[5];
  38. BEGIN
  39.   If Year < 1583 then
  40.   begin
  41.     Writeln('Year must be 1583 or later.');
  42.     Exit;
  43.   end;
  44.  
  45.   a := Year MOD 19;
  46.   b := Year DIV 100;
  47.   c := Year MOD 100;
  48.   d := b DIV 4;
  49.   e := b MOD 4;
  50.   f := (b + 8) DIV 25;
  51.   g := (b - f + 1) DIV 3;
  52.   h := (19 * a + b - d - g + 15) MOD 30;
  53.   i := c DIV 4;
  54.   k := c MOD 4;
  55.   l := (32 + 2 * e + 2 * i - h - k) MOD 7;
  56.   m := (a + 11 * h + 22 * l) DIV 451;
  57.   p := (h + l - 7 * m + 114);
  58.   n := p DIV 31;                  (* n = month number 3 or 4  *)
  59.   p := (p MOD 31) + 1;            (* p = day in month         *)
  60.  
  61.   IF (n = 3) THEN
  62.     Month := 'March'
  63.   ELSE
  64.     Month := 'April';
  65.  
  66.   WriteLn('The date of Easter for ', Year : 4, ' is: ', Month, p : 3);
  67.  
  68. END;
  69.  
  70.  
  71. begin
  72.   FindEaster(1993);
  73. end.